package com.pic.mgt.haishin.manager.terminal;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.pic.mgt.HaishinLauncher;
import com.pic.mgt.manager.terminal.TerminalManagementOperationException;
import com.pic.mgt.manager.terminal.TerminalManager;

public class HaishinTerminalSyncExecutionQuartzJob extends QuartzJobBean {

	@Override
	protected void executeInternal(JobExecutionContext arg0)
	throws JobExecutionException {
		TerminalManager terminalManager = HaishinLauncher.applicationContext.getBean(
				"simpleHaishinTerminalManager",
				TerminalManager.class);
		try {
			terminalManager.synchronizeTerminals();
		} catch (TerminalManagementOperationException e) {
			e.printStackTrace();
			// 不用寫 Log
		}
	}

}
